package com.woniu.finance.contorller;


import com.woniu.aop.OperationLogAnnotation;
import com.woniu.finance.entity.FinanceUser;
import com.woniu.finance.entity.RequestParam;
import com.woniu.finance.service.IUserService;
import com.woniu.util.utils.HttpResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 刘品水
 * @since 2023-05-05
 */
@RestController
@RequestMapping("/finance/user")
public class UserController {
    @Autowired
    private IUserService userService;

    @RequestMapping("getEnterpriseIdByUserName")
    @OperationLogAnnotation(operModul = "融资企业-根据用户账号查询融资企业表id", operType = "查询", operDesc = "根据用户账号查询融资企业表id")//操作日志注解
    public HttpResult<?> getEnterpriseIdByUserName(String userName) {
        return userService.getEnterpriseIdByUserName(userName);
    }
    @RequestMapping("getUserIdByUserName")
    @OperationLogAnnotation(operModul = "融资企业-根据用户账号查询用户id", operType = "查询", operDesc = "根据用户账号查询用户id")//操作日志注解
    public HttpResult<?> getUserIdByUserName(String userName) {
        return userService.getUserIdByUserName(userName);
    }

    @RequestMapping("findAllUserByEnterpriseId")
    @OperationLogAnnotation(operModul = "融资企业-根据用户账号查询用户id", operType = "查询", operDesc = "根据用户账号查询用户id")//操作日志注解
    public HttpResult<?> findAllUserByEnterpriseId(@RequestBody RequestParam<FinanceUser> param) {
        return userService.findAllUserByEnterpriseId(param);
    }

    @RequestMapping("insertUserInfo")
    public HttpResult<?> insertUserInfo(@RequestBody FinanceUser financeUser) {
        return userService.insertUserInfo(financeUser);
    }


}
